<template>
  <div class="left">
    <h2>Left组件</h2>
    <button @click="sendData">发送</button>
    <Article></Article>
  </div>
</template>

<script>
import bus from './bus.js'

export default {
  data() {
    return {
      username: 'lisi',
      age: 40
    }
  },
  // 写到created里面的好处是，created在数据创建之后，会自动执行
  methods: {
    sendData() {
      bus.$emit('share', this.username, this.age)
    }
  }
}
</script>

<style lang="less" scoped>
.left {
  background-color: darkorange;
}
</style>
